<?php
class Outputter
{
    public static $game = "1";
    public $nogame = "2";

    public function __construct()
    {
        echo "get class";
    }
    public function Findme()
    {
        echo "找到我了吗？";
    }
}
interface game
{

}
class Outputter_children extends Outputter implements game
{

}

$prod_class = new ReflectionClass('Outputter');
Reflection::export($prod_class);
echo "<br> 用var_dump() <br>";
var_dump(new Outputter());
echo "<br>detailed to show <br>";
function classData(ReflectionClass $class)
{
    $detail = "it is test much methods";//返回信息
    $name = $class->getName();
    if ($class->isUserDefined()) {
        // if class didn't define, return false;
        $detail .= "$name is user defined <br>";
    }
    if ($class->isInternal()) {
        $detail .= "$name is built-in </br>";
    }
    if ($class->isAbstract()) {
        $detail .= "$name is Abstract class </br>";
        //抽象
    }
    if ($class->isFinal()) {
        $detail .= "$name is final class </br>";
    }
    if ($class->isInstantiable()) {
        $detail .= "$name  is instant class </br>";
    }
    return $detail;
}
print classData($prod_class);
//这是方法来测试类的由来
class ReflectionUtil
{
    static function get_ClassSource(ReflectionClass $class)
    {
        $path = $class->getFileName();
        $lines = @file($path);
        // echo $path."<br>";
        // var_dump($lines);
        $from = $class->getStartLine();
        //开始行数
        $to = $class->getEndLIne();
        //结束行数
        $len = $to - $from + 1;
        return implode(array_slice($lines, $from - 1, $len));
    }
}
print ReflectionUtil::get_ClassSource($prod_class);


?>